/*--------------------------------------------------------------------------------------------------
Yatak Operation System Project Copyright 2012-2013
Author : Ilya Churaev
Started : 23 Apr 2012	Updated : 30 Jan 2013
File Name : shell.h     Purpose : main terminal
--------------------------------------------------------------------------------------------------*/
#ifndef _SHELL_H
#define _SHELL_H

#ifdef __cplusplus
extern "C" {
#endif

#include <yatak/debug.h>
#include <sys/types.h>
#include <fs.h>

//#define DEBUG_SHELL

#ifndef DEBUG_SHELL
#define dprintf
#define DBGPRINTF(s)
#endif

#define MAX_LONG 64
#define COMM_ARR_SIZE 26

struct shell_var
{
	void * value;
	uint32 size;
	char name [MAX_LONG];
	int types;				// local export, global...
	struct shell_var * next;
	struct shell_var * back;
};

typedef struct shell_var shell_var_t;

void start_shell ();
char * rsa_decoder (fs_node_t *file, unsigned int * seek);
void cat_decoder (char * param);
int command_line (char * line);
void cat (char * param);
void cd (char * param);
int kill (char * param);
void us_exit ();
void su (const char * param);
void ps ();
void ls ();
void reboot ();
void shut_down ();
void TestTask (char * line);
int shell_interp (fs_node_t * file);
void echo (char * line);
void PrintASCIITable ();
void log_app (char * param);
void print_time ();
void print_date ();
void Help ();
void mem_usage ();
void sys_info ();
void TerminalColors ();
void print_whoami ();
void module_mem_test ();

int CreateVariable (char * name, void * value,uint32 size);
int DeleteVariable (char * name);
void * GetVariable (char * name);
uint32 GetVariableSize (char * name);
int executive_line (char *line);

void print_user_str ();

int exec_line (char * com);

fs_node_t * GetRootFS ();
fs_node_t * GetCurrentNodeDir ();
void SetCurrentNodeDir (fs_node_t * dir);
char * GetCurrentDir ();
void SetCurrentDir (char * dir);

#ifdef __cplusplus
}
#endif

#endif
